var local="http://47.104.10.151";
var xmlHttp;
var keyId=getCookie('userId');
var page1=0;
var page2=0;
var page3=0;
var totalPages1;
var totalPages2;
var totalPages3;
function getCookie(c_name)
{
    if (document.cookie.length>0)
    {
        c_start=document.cookie.indexOf(c_name + "=")
        if (c_start!=-1)
        {
            c_start=c_start + c_name.length+1
            c_end=document.cookie.indexOf(";",c_start)
            if (c_end==-1) c_end=document.cookie.length
            return unescape(document.cookie.substring(c_start,c_end))
        }
    }
    return "";
}
var bid_id1;
var bid_id2;
var bid_id3;
var bid_id4;
var bid_id5;
var bid_id6;

var bid_userId1;
var bid_userId2;
var bid_userId3;
var bid_userId4;
var bid_userId5;
var bid_userId6;

var votebid_id1;
var votebid_id2;
var votebid_id3;
var votebid_id4;
var votebid_id5;
var votebid_id6;

var totalPages;
var address_bid1;
var address_bid2;
var address_bid3;
var address_bid4;
var address_bid5;
var address_bid6;


var bid_selled_id1;
var bid_selled_id2;
var bid_selled_id3;
var bid_selled_id4;
var bid_selled_id5;
var bid_selled_id6;



function creatxmlHTTP() {
    if(window.XMLHttpRequest){
//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
        xmlHttp=new XMLHttpRequest();
    }else {
        // IE6, IE5 浏览器执行代码
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

    return xmlHttp;
}

function SeachBids() {
    xmlHttp = creatxmlHTTP();
    var txt = "";//用于存储拼接字符串；
    var url=local+":8080/voteBid/findVoteBidByStatus1";
    //拼接字符
    txt ="&page=" + page1;
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);

    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
            var result = xmlHttp.responseText;
            var json = eval("(" + result + ")");

            var input1 = document.getElementsByName("Stock1");
            if (json.data.content[0].tax_status == 0) {
                input1[2].value = "无税率";
            } else if(json.data.content[0].tax_status == 1){
                input1[2].value = "17%";
            }

            totalPages1=json.data.totalPages;
            bid_id1 = json.data.content[0].keyId;
            bid_userId1=json.data.content[0].bid_user_id;
            votebid_id1=json.data.content[0].voteUser_id;
            input1[0].value = json.data.content[0].company_code;
            input1[1].value = json.data.content[0].voteBid_code;
            input1[3].value = json.data.content[0].product_name;
            input1[4].value = json.data.content[0].model;
            input1[5].value = json.data.content[0].size;
            input1[6].value = json.data.content[0].brand;
            input1[7].value = json.data.content[0].inventory;


            var input2 = document.getElementsByName("Stock2");

            if (json.data.content[1].tax_status == 0) {
                input2[2].value = "无税率";
            } else if(json.data.content[1].tax_status == 1){
                input2[2].value = "17%";
            }
            bid_id2 = json.data.content[1].keyId;
            bid_userId2=json.data.content[1].bid_user_id;
            votebid_id2=json.data.content[1].voteUser_id;
            input2[0].value = json.data.content[1].company_code;
            input2[1].value = json.data.content[1].voteBid_code;
            input2[3].value = json.data.content[1].product_name;
            input2[4].value = json.data.content[1].model;
            input2[5].value = json.data.content[1].size;
            input2[6].value = json.data.content[1].brand;
            input2[7].value = json.data.content[1].inventory;

            var input3 = document.getElementsByName("Stock3");
            if (json.data.content[2].tax_status == 0) {
                input3[2].value = "无税率";
            } else if(json.data.content[2].tax_status == 1){
                input3[2].value = "17%";
            }
            bid_id3 = json.data.content[2].keyId;
            bid_userId3=json.data.content[2].bid_user_id;
            votebid_id3=json.data.content[2].voteUser_id;
            input3[0].value = json.data.content[2].company_code;
            input3[1].value = json.data.content[2].voteBid_code;
            input3[3].value = json.data.content[2].product_name;
            input3[4].value = json.data.content[2].model;
            input3[5].value = json.data.content[2].size;
            input3[6].value = json.data.content[2].brand;
            input3[7].value = json.data.content[2].inventory;


            var input4 = document.getElementsByName("Stock4");
            if (json.data.content[3].tax_status == 0) {
                input4[2].value = "无税率";
            } else if(json.data.content[3].tax_status == 1){
                input4[2].value = "17%";
            }
            bid_id4 = json.data.content[3].keyId;
            bid_userId4=json.data.content[3].bid_user_id;
            votebid_id4=json.data.content[3].voteUser_id;
            input4[0].value = json.data.content[3].company_code;
            input4[1].value = json.data.content[3].voteBid_code;
            input4[3].value = json.data.content[3].product_name;
            input4[4].value = json.data.content[3].model;
            input4[5].value = json.data.content[3].size;
            input4[6].value = json.data.content[3].brand;
            input4[7].value = json.data.content[3].inventory;

            var input5 = document.getElementsByName("Stock5");
            if (json.data.content[4].tax_status == 0) {
                input5[2].value = "无税率";
            } else if(json.data.content[4].tax_status == 1){
                input5[2].value = "17%";
            }
            bid_id5 = json.data.content[4].keyId;
            bid_userId5=json.data.content[4].bid_user_id;
            votebid_id5=json.data.content[4].voteUser_id;
            input5[0].value = json.data.content[4].company_code;
            input5[1].value = json.data.content[4].voteBid_code;
            input5[3].value = json.data.content[4].product_name;
            input5[4].value = json.data.content[4].model;
            input5[5].value = json.data.content[4].size;
            input5[6].value = json.data.content[4].brand;
            input5[7].value = json.data.content[4].inventory;

            var input6 = document.getElementsByName("Stock6");
            if (json.data.content[5].tax_status == 0) {
                input6[2].value = "无税率";
            } else {if(json.data.content[5].tax_status == 1)
                input6[2].value = "17%";
            }
            bid_id6 = json.data.content[5].keyId;
            bid_userId6=json.data.content[5].bid_user_id;
            votebid_id6=json.data.content[5].voteUser_id;
            input6[0].value = json.data.content[5].company_code;
            input6[1].value = json.data.content[5].voteBid_code;
            input6[3].value = json.data.content[5].product_name;
            input6[4].value = json.data.content[5].model;
            input6[5].value = json.data.content[5].size;
            input6[6].value = json.data.content[5].brand;
            input6[7].value = json.data.content[5].inventory;


        }
    }

}

function addBid() {

    if(totalPages1>=page1+1){
        page1++;
        for(var i=0;i<document.getElementsByName("Stock1").length;i++){
            document.getElementsByName("Stock1")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock2").length;i++){
            document.getElementsByName("Stock2")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock3").length;i++){
            document.getElementsByName("Stock3")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock4").length;i++){
            document.getElementsByName("Stock4")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock4").length;i++){
            document.getElementsByName("Stock5")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock4").length;i++){
            document.getElementsByName("Stock6")[i].value="";
        }
        SeachBids();
    }
        else {
        alert("已经是最后一页");
        page1--;
    }

}
function decBid() {

    if(page1-1>=0){
        page1--;
        for(var i=0;i<document.getElementsByName("Stock1").length;i++){
            document.getElementsByName("Stock1")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock2").length;i++){
            document.getElementsByName("Stock2")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock3").length;i++){
            document.getElementsByName("Stock3")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock4").length;i++){
            document.getElementsByName("Stock4")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock5").length;i++){
            document.getElementsByName("Stock5")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock6").length;i++){
            document.getElementsByName("Stock6")[i].value="";
        }
        SeachBids();
    }
    else {
        alert("第一页");
    }

}


function payConfrimBid1() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/voteBid/orderChangeTo1";
    var txt;//用于存储拼接字符串；
    txt="order_id="+bid_id1;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;

            address_bid1=json.data.address;
            sendmsgConfirmMoney_bid1();
            sendmsgToSeller_bid1();
            alert("Keyid1"+msg);
        }
    }
}

function payConfrimBid2() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/voteBid/orderChangeTo1";
    var txt;//用于存储拼接字符串；
    txt="order_id="+bid_id2;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            address_bid2=json.data.address;
            sendmsgConfirmMoney_bid2();
            sendmsgToSeller_bid2();

            alert("Keyid2"+msg);
        }
    }
}

function payConfrimBid3() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/voteBid/orderChangeTo1";
    var txt;//用于存储拼接字符串；
    txt="order_id="+bid_id3;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;

            address_bid3=json.data.address;
            sendmsgConfirmMoney_bid3();
            sendmsgToSeller_bid3();
            alert("Keyid3"+msg);
        }
    }
}

function payConfrimBid4() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/voteBid/orderChangeTo1";
    var txt;//用于存储拼接字符串；
    txt="order_id="+bid_id4;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            address_bid4=json.data.address;
            sendmsgConfirmMoney_bid4();
            sendmsgToSeller_bid4();
            alert("Keyid4"+msg);
        }
    }
}

function payConfrimBid5() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/voteBid/orderChangeTo1";
    var txt;//用于存储拼接字符串；
    txt="order_id="+bid_id5;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);

    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            address_bid5=json.data.address;
            sendmsgConfirmMoney_bid5();
            sendmsgToSeller_bid5();
            alert("Keyid5"+msg);
        }
    }
}

function payConfrimBid6() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/voteBid/orderChangeTo1";
    var txt;//用于存储拼接字符串；
    txt="order_id="+bid_id6;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);

    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            address_bid6=json.data.address;
            sendmsgConfirmMoney_bid6();
            sendmsgToSeller_bid6();
            alert("Keyid6"+msg);
        }
    }
}

function creatxmlHTTP() {
    if(window.XMLHttpRequest){
//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
        xmlHttp=new XMLHttpRequest();
    }else {
        // IE6, IE5 浏览器执行代码
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    return xmlHttp;
}





function sendmsgConfirmMoney_bid1() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    txt="user_id="+bid_userId1+"&message="+"平台确认收款请及时查看物流信息";
    alert(txt);
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}

function sendmsgConfirmMoney_bid2() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    txt="user_id="+bid_userId2+"&message="+"平台确认收款请及时查看物流信息";
    alert(txt);
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);

}
function sendmsgConfirmMoney_bid3() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    txt="user_id="+bid_userId3+"&message="+"平台确认收款请及时查看物流信息";
    alert(txt);
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);

}
function sendmsgConfirmMoney_bid4() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    txt="user_id="+bid_userId4+"&message="+"平台确认收款请及时查看物流信息";
    alert(txt);
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);

}
function sendmsgConfirmMoney_bid5() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    txt="user_id="+bid_userId5+"&message="+"平台确认收款请及时查看物流信息";
    alert(txt);
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);

}
function sendmsgConfirmMoney_bid6() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    txt="user_id="+bid_userId6+"&message="+"平台确认收款请及时查看物流信息";
    alert(txt);
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);

}


function sendmsgToSeller_bid1() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    var address="买家地址为"+address_bid1+"请及时发货";
    txt="user_id="+votebid_id1+"&message="+address;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}




function sendmsgToSeller_bid2() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    var address="买家地址为"+address_bid2+"请及时发货";
    txt="user_id="+votebid_id2+"&message="+address;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}

function sendmsgToSeller_bid3() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    var address="买家地址为"+address_bid3+"请及时发货";
    txt="user_id="+votebid_id3+"&message="+address;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}

function sendmsgToSeller_bid4() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    var address="买家地址为"+address_bid4+"请及时发货";
    txt="user_id="+votebid_id4+"&message="+address;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}

function sendmsgToSeller_bid5() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    var address="买家地址为"+address_bid5+"请及时发货";
    txt="user_id="+votebid_id5+"&message="+address;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}

function sendmsgToSeller_bid6() {
    var xmlHttp;
    xmlHttp=creatxmlHTTP();
    var url=local+":8080/messageController/saveMessage";
    var txt;//用于存储拼接字符串；
    var address="买家地址为"+address_bid6+"请及时发货";
    txt="user_id="+votebid_id6+"&message="+address;
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}





function seachBidBySelled() {

    function creatxmlHTTP1() {
        if(window.XMLHttpRequest){
//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlHttp=new XMLHttpRequest();
        }else {
            // IE6, IE5 浏览器执行代码
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        return xmlHttp;
    }


    xmlHttp1 = creatxmlHTTP1();
    var txt = "page="+page2;//用于存储拼接字符串；
    var url=local+":8080/voteBid/findVoteBidByStatus3";
    //拼接字符
    xmlHttp1.open("POST", url, true);
    xmlHttp1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp1.send(txt);

    xmlHttp1.onreadystatechange = function () {
        if (xmlHttp1.readyState == 4 && xmlHttp1.status == 200) {
            var result = xmlHttp1.responseText;
            var json = eval("(" + result + ")");


            var input1 = document.getElementsByName("Stock11");
            if (json.data.content[0].tax_status == 0) {
                input1[2].value = "无税率";
            } else if (json.data.content[0].tax_status == 1) {
                input1[2].value = "17%";
            }
            bid_selled_id1 = json.data.content[0].keyId;
            input1[0].value = json.data.content[0].company_code;
            input1[1].value = json.data.content[0].voteBid_code;
            input1[3].value = json.data.content[0].product_name;
            input1[4].value = json.data.content[0].model;
            input1[5].value = json.data.content[0].size;
            input1[6].value = json.data.content[0].brand;
            input1[7].value = json.data.content[0].inventory;

            totalPages2=json.data.totalPages;


            var input2 = document.getElementsByName("Stock12");
            if (json.data.content[1].tax_status == 0) {
                input2[2].value = "无税率";
            } else if (json.data.content[1].tax_status == 1) {
                input2[2].value = "17%";
            }
            bid_selled_id2 = json.data.content[1].keyId;
            input2[0].value = json.data.content[1].company_code;
            input2[1].value = json.data.content[1].voteBid_code;
            input2[3].value = json.data.content[1].product_name;
            input2[4].value = json.data.content[1].model;
            input2[5].value = json.data.content[1].size;
            input2[6].value = json.data.content[1].brand;
            input2[7].value = json.data.content[1].inventory;


            var input3 = document.getElementsByName("Stock13");
            if (json.data.content[0].tax_status == 0) {
                input3[2].value = "无税率";
            } else if (json.data.content[0].tax_status == 1) {
                input3[2].value = "17%";
            }
            bid_selled_id3 = json.data.content[2].keyId;
            input3[0].value = json.data.content[2].company_code;
            input3[1].value = json.data.content[2].voteBid_code;
            input3[3].value = json.data.content[2].product_name;
            input3[4].value = json.data.content[2].model;
            input3[5].value = json.data.content[2].size;
            input3[6].value = json.data.content[2].brand;
            input3[7].value = json.data.content[2].inventory;

            var input4 = document.getElementsByName("Stock14");
            if (json.data.content[3].tax_status == 0) {
                input4[2].value = "无税率";
            } else if (json.data.content[3].tax_status == 1) {
                input4[2].value = "17%";
            }
            bid_selled_id4 = json.data.content[3].keyId;
            input4[0].value = json.data.content[3].company_code;
            input4[1].value = json.data.content[3].voteBid_code;
            input4[3].value = json.data.content[3].product_name;
            input4[4].value = json.data.content[3].model;
            input4[5].value = json.data.content[3].size;
            input4[6].value = json.data.content[3].brand;
            input4[7].value = json.data.content[3].inventory;


            var input5 = document.getElementsByName("Stock15");
            if (json.data.content[4].tax_status == 0) {
                input5[2].value = "无税率";
            } else if (json.data.content[4].tax_status == 1) {
                input5[2].value = "17%";
            }
            bid_selled_id5 = json.data.content[4].keyId;
            input5[0].value = json.data.content[4].company_code;
            input5[1].value = json.data.content[4].voteBid_code;
            input5[3].value = json.data.content[4].product_name;
            input5[4].value = json.data.content[4].model;
            input5[5].value = json.data.content[4].size;
            input5[6].value = json.data.content[4].brand;
            input5[7].value = json.data.content[4].inventory;


            var input6 = document.getElementsByName("Stock16");
            if (json.data.content[5].tax_status == 0) {
                input6[2].value = "无税率";
            } else if (json.data.content[5].tax_status == 1) {
                input6[2].value = "17%";
            }
            bid_selled_id6 = json.data.content[5].keyId;
            input6[0].value = json.data.content[5].company_code;
            input6[1].value = json.data.content[5].voteBid_code;
            input6[3].value = json.data.content[5].product_name;
            input6[4].value = json.data.content[5].model;
            input6[5].value = json.data.content[5].size;
            input6[6].value = json.data.content[5].brand;
            input6[7].value = json.data.content[5].inventory;
        }
    }
}

function addBidBySelled() {
    if(totalPages2>page2+1){
        for(var i=0;i<document.getElementsByName("Stock11").length;i++){
            document.getElementsByName("Stock11")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock12").length;i++){
            document.getElementsByName("Stock12")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock13").length;i++){
            document.getElementsByName("Stock13")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock14").length;i++){
            document.getElementsByName("Stock14")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock15").length;i++){
            document.getElementsByName("Stock15")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock16").length;i++){
            document.getElementsByName("Stock16")[i].value="";
        }
        page2++;
        seachBidBySelled();
    }
    else alert("已经是最后一页");

}
function decBidBySelled() {
    if(page2-1>=0){
        for(var i=0;i<document.getElementsByName("Stock11").length;i++){
            document.getElementsByName("Stock11")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock12").length;i++){
            document.getElementsByName("Stock12")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock13").length;i++){
            document.getElementsByName("Stock13")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock14").length;i++){
            document.getElementsByName("Stock14")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock15").length;i++){
            document.getElementsByName("Stock15")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock16").length;i++){
            document.getElementsByName("Stock16")[i].value="";
        }
        page2--;
        seachBidBySelled();
    }
    else alert("第一页");
}

function jiekuanComfirm_bid1() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+bid_selled_id1;
    var url=local+":8080/voteBid/orderChangeTo6";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}
function jiekuanComfirm_bid2() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+bid_selled_id2;
    var url=local+":8080/voteBid/orderChangeTo6";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}
function jiekuanComfirm_bid3() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+bid_selled_id3;
    var url=local+":8080/voteBid/orderChangeTo6";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}
function jiekuanComfirm_bid4() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+bid_selled_id4;
    var url=local+":8080/voteBid/orderChangeTo6";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}
function jiekuanComfirm_bid5() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+bid_selled_id5;
    var url=local+":8080/voteBid/orderChangeTo6";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}
function jiekuanComfirm_bid6() {
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+bid_selled_id6;
    var url=local+":8080/voteBid/orderChangeTo6";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    alert("订单确认结款，订单完成");
}

function finishBids() {
    function creatxmlHTTP22() {
        if(window.XMLHttpRequest){
//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlHttp=new XMLHttpRequest();
        }else {
            // IE6, IE5 浏览器执行代码
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        return xmlHttp;
    }


    var xmlHttp1 = creatxmlHTTP22();
    var txt = "";//用于存储拼接字符串；
    var url=local+":8080/voteBid/findVoteBidByComplicate";
    //拼接字符
    txt="page="+page3;
    xmlHttp1.open("POST", url, true);
    xmlHttp1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp1.send(txt);

    xmlHttp1.onreadystatechange = function () {
        if (xmlHttp1.readyState == 4 && xmlHttp1.status == 200) {
            var result = xmlHttp1.responseText;
            var json = eval("(" + result + ")");


            totalPages3=json.data.totalPages;
            var input1 = document.getElementsByName("Stock111");
            if (json.data.content[0].tax_status == 0) {
                input1[2].value = "无税率";
            } else if (json.data.content[0].tax_status == 1) {
                input1[2].value = "17%";
            }
            input1[0].value = json.data.content[0].company_code;
            input1[1].value = json.data.content[0].voteBid_code;
            input1[3].value = json.data.content[0].product_name;
            input1[4].value = json.data.content[0].model;
            input1[5].value = json.data.content[0].size;
            input1[6].value = json.data.content[0].brand;
            input1[7].value = json.data.content[0].inventory;



            var input2 = document.getElementsByName("Stock122");
            if (json.data.content[1].tax_status == 0) {
                input2[2].value = "无税率";
            } else if (json.data.content[1].tax_status == 1) {
                input2[2].value = "17%";
            }
            input2[0].value = json.data.content[1].company_code;
            input2[1].value = json.data.content[1].voteBid_code;
            input2[3].value = json.data.content[1].product_name;
            input2[4].value = json.data.content[1].model;
            input2[5].value = json.data.content[1].size;
            input2[6].value = json.data.content[1].brand;
            input2[7].value = json.data.content[1].inventory;


            var input3 = document.getElementsByName("Stock133");
            if (json.data.content[2].tax_status == 0) {
                input3[2].value = "无税率";
            } else if (json.data.content[2].tax_status == 1) {
                input3[2].value = "17%";
            }
            input3[0].value = json.data.content[2].company_code;
            input3[1].value = json.data.content[2].voteBid_code;
            input3[3].value = json.data.content[2].product_name;
            input3[4].value = json.data.content[2].model;
            input3[5].value = json.data.content[2].size;
            input3[6].value = json.data.content[2].brand;
            input3[7].value = json.data.content[2].inventory;

            var input4 = document.getElementsByName("Stock144");
            if (json.data.content[3].tax_status == 0) {
                input4[2].value = "无税率";
            } else if (json.data.content[3].tax_status == 1) {
                input4[2].value = "17%";
            }
            input4[0].value = json.data.content[3].company_code;
            input4[1].value = json.data.content[3].voteBid_code;
            input4[3].value = json.data.content[3].product_name;
            input4[4].value = json.data.content[3].model;
            input4[5].value = json.data.content[3].size;
            input4[6].value = json.data.content[3].brand;
            input4[7].value = json.data.content[3].inventory;


            var input5 = document.getElementsByName("Stock155");
            if (json.data.content[4].tax_status == 0) {
                input5[2].value = "无税率";
            } else if (json.data.content[4].tax_status == 1) {
                input5[2].value = "17%";
            }
            input5[0].value = json.data.content[4].company_code;
            input5[1].value = json.data.content[4].voteBid_code;
            input5[3].value = json.data.content[4].product_name;
            input5[4].value = json.data.content[4].model;
            input5[5].value = json.data.content[4].size;
            input5[6].value = json.data.content[4].brand;
            input5[7].value = json.data.content[4].inventory;


            var input6 = document.getElementsByName("Stock166");
            if (json.data.content[5].tax_status == 0) {
                input6[2].value = "无税率";
            } else if (json.data.content[5].tax_status == 1) {
                input6[2].value = "17%";
            }
            input6[0].value = json.data.content[5].company_code;
            input6[1].value = json.data.content[5].voteBid_code;
            input6[3].value = json.data.content[5].product_name;
            input6[4].value = json.data.content[5].model;
            input6[5].value = json.data.content[5].size;
            input6[6].value = json.data.content[5].brand;
            input6[7].value = json.data.content[5].inventory;
        }
    }

}

function addBidComplicate() {
    if(totalPages3>page3+1){
        for(var i=0;i<document.getElementsByName("Stock111").length;i++){
            document.getElementsByName("Stock111")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock122").length;i++){
            document.getElementsByName("Stock122")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock133").length;i++){
            document.getElementsByName("Stock133")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock144").length;i++){
            document.getElementsByName("Stock144")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock155").length;i++){
            document.getElementsByName("Stock155")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock166").length;i++){
            document.getElementsByName("Stock166")[i].value="";
        }
        page3++;
        finishBids();
    }
    else alert("已经是最后一页");

}
function decBidComlicate() {
    if(page3-1>=0){
        for(var i=0;i<document.getElementsByName("Stock11").length;i++){
            document.getElementsByName("Stock11")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock12").length;i++){
            document.getElementsByName("Stock12")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock13").length;i++){
            document.getElementsByName("Stock13")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock14").length;i++){
            document.getElementsByName("Stock14")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock15").length;i++){
            document.getElementsByName("Stock15")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Stock16").length;i++){
            document.getElementsByName("Stock16")[i].value="";
        }
        page3--;
        finishBids();
    }
    else alert("第一页");
}